/*    */ package com.newcrm.webapi.sub;
/*    */ 
/*    */ import com.newcrm.bean.User;
/*    */ import com.newcrm.db.CustomerManager;
/*    */ import com.newcrm.exception.NotFoundException;
/*    */ import com.newcrm.webapi.AbstractAction;
/*    */ import com.newcrm.webapi.AbstractHttpServlet;
/*    */ import java.io.IOException;
/*    */ import java.io.PrintWriter;
/*    */ import java.util.List;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import net.sf.json.JSONObject;
/*    */ import org.apache.log4j.Logger;
/*    */ 
/*    */ public class ListLastCustomer extends AbstractAction
/*    */ {
/* 24 */   private static Logger logger = Logger.getLogger(ListLastCustomer.class
/* 25 */     .getName());
/*    */ 
/*    */   public ListLastCustomer(AbstractHttpServlet servlet)
/*    */   {
/* 28 */     super(servlet);
/*    */   }
/*    */ 
/*    */   public void parse(HttpServletRequest request, HttpServletResponse response)
/*    */     throws IOException, ServletException, NotFoundException
/*    */   {
/* 34 */     User user = super.getLoginUser(request);
/* 35 */     CustomerManager manager = new CustomerManager();
/* 36 */     response.setContentType("text/html;charset=utf-8");
/* 37 */     PrintWriter out = response.getWriter();
/* 38 */     JSONObject jsonObject = new JSONObject();
/*    */     try {
/* 40 */       List result = manager
/* 41 */         .getLastContactCustomer(user.userId);
/* 42 */       jsonObject.put("error", "0");
/* 43 */       jsonObject.put("customers", result);
/*    */     } catch (Exception e) {
/* 45 */       jsonObject.put("error", "1");
/* 46 */       logger.warn(e);
/*    */     }
/* 48 */     out.println(jsonObject);
/* 49 */     out.flush();
/* 50 */     out.close();
/*    */   }
/*    */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.sub.ListLastCustomer
 * JD-Core Version:    0.6.1
 */